import axios from '@/core/utils/AxiosRequest'

/**
 * 内容-标签-接口
 */
const prefix = '/api/content/tags'
export default {
  /**
   * 获取分页表
   * @param {*} payload
   * @returns
   */
  getListByPage(payload) {
    console.info(JSON.stringify(payload))
    return axios.get(prefix + '/getListDataByPage', { params: payload })
  },

  /**
   * 获取按ID获取表单信息
   * @param {*} id
   * @returns
   */
  getFormModelById(id) {
    return axios.get(prefix + '/getFormDataById?id='+id)
  },

  /**
   * 保存数据
   * @param {*} payload
   * @returns
   */
  saveData(payload) {
    return axios.post(prefix + '/saveData', payload)
  },


  /**
   * 多个key删除数据
   * @param {key[]} payload
   * @returns
   */
  removeData(payload) {
    return axios.get(prefix + '/remove', {params: payload})
  },

  /**
   * 审核
   * @param {
   *  keys: [],
   *  action: 'reject/approve',
   *  reason: '原因'
   * } payload
   * @returns
   */
  auditData(payload) {
    return axios.get(prefix + '/auditData', { params: payload })
  },
  
  /**
   * 确认 - 激活
   * @param {keys: []} payload
   * @returns
   */
  activeData(payload) {
    return axios.get(prefix + '/active', { params: payload })
  },

  /**
   * 确认
   * @param {keys: []} payload
   * @returns
   */
  confirmData(payload) {
    return axios.get(prefix + '/confirmData', { params: payload })
  },

  /**
   * 获取所数据记录
   * @returns
   */
  getOptions() {
    return axios.get(prefix + '/options')
  },
}